.class public Lcom/instagram/android/feed/a/a/g;
.super Ljava/lang/Object;
.source "FeedMediaCacheWarmer.java"


# instance fields
.field private final a:Lcom/instagram/android/feed/a/a;

.field private final b:Lcom/instagram/f/b/c;

.field private c:I

.field private d:I

.field private e:I


# direct methods
.method public constructor <init>(Lcom/instagram/android/feed/a/a;Lcom/instagram/f/b/c;)V
    .locals 1
    .parameter
    .parameter

    .prologue
    .line 24
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 20
    const/4 v0, 0x0

    iput v0, p0, Lcom/instagram/android/feed/a/a/g;->c:I

    .line 21
    const/high16 v0, -0x8000

    iput v0, p0, Lcom/instagram/android/feed/a/a/g;->d:I

    .line 22
    const v0, 0x7fffffff

    iput v0, p0, Lcom/instagram/android/feed/a/a/g;->e:I

    .line 25
    iput-object p1, p0, Lcom/instagram/android/feed/a/a/g;->a:Lcom/instagram/android/feed/a/a;

    .line 26
    iput-object p2, p0, Lcom/instagram/android/feed/a/a/g;->b:Lcom/instagram/f/b/c;

    .line 27
    return-void
.end method

.method private a(I)V
    .locals 2
    .parameter

    .prologue
    .line 46
    const v0, 0x7fffffff

    iput v0, p0, Lcom/instagram/android/feed/a/a/g;->e:I

    .line 48
    iget v0, p0, Lcom/instagram/android/feed/a/a/g;->d:I

    invoke-static {p1, v0}, Ljava/lang/Math;->max(II)I

    move-result v0

    add-int/lit8 v0, v0, 0x1

    .line 49
    add-int/lit8 v1, p1, 0x2

    .line 51
    :goto_0
    if-gt v0, v1, :cond_0

    .line 52
    invoke-direct {p0, v0}, Lcom/instagram/android/feed/a/a/g;->c(I)V

    .line 51
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 55
    :cond_0
    iput v1, p0, Lcom/instagram/android/feed/a/a/g;->d:I

    .line 56
    return-void
.end method

.method private b(I)V
    .locals 2
    .parameter

    .prologue
    .line 62
    const/high16 v0, -0x8000

    iput v0, p0, Lcom/instagram/android/feed/a/a/g;->d:I

    .line 64
    iget v0, p0, Lcom/instagram/android/feed/a/a/g;->e:I

    invoke-static {p1, v0}, Ljava/lang/Math;->min(II)I

    move-result v0

    add-int/lit8 v0, v0, -0x1

    .line 65
    add-int/lit8 v1, p1, -0x2

    .line 67
    :goto_0
    if-lt v0, v1, :cond_0

    .line 68
    invoke-direct {p0, v0}, Lcom/instagram/android/feed/a/a/g;->c(I)V

    .line 67
    add-int/lit8 v0, v0, -0x1

    goto :goto_0

    .line 71
    :cond_0
    iput v1, p0, Lcom/instagram/android/feed/a/a/g;->e:I

    .line 72
    return-void
.end method

.method private c(I)V
    .locals 2
    .parameter

    .prologue
    .line 75
    if-ltz p1, :cond_0

    iget-object v0, p0, Lcom/instagram/android/feed/a/a/g;->a:Lcom/instagram/android/feed/a/a;

    invoke-virtual {v0}, Lcom/instagram/android/feed/a/a;->getCount()I

    move-result v0

    if-ge p1, v0, :cond_0

    .line 76
    iget-object v0, p0, Lcom/instagram/android/feed/a/a/g;->a:Lcom/instagram/android/feed/a/a;

    invoke-virtual {v0, p1}, Lcom/instagram/android/feed/a/a;->getItem(I)Ljava/lang/Object;

    move-result-object v0

    .line 78
    instance-of v1, v0, Lcom/instagram/j/l;

    if-eqz v1, :cond_0

    .line 79
    iget-object v1, p0, Lcom/instagram/android/feed/a/a/g;->b:Lcom/instagram/f/b/c;

    check-cast v0, Lcom/instagram/j/l;

    check-cast v0, Lcom/instagram/j/l;

    invoke-virtual {v0}, Lcom/instagram/j/l;->y()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v1, v0}, Lcom/instagram/f/b/c;->a(Ljava/lang/String;)V

    .line 82
    :cond_0
    return-void
.end method


# virtual methods
.method public a(Landroid/widget/AbsListView;I)V
    .locals 3
    .parameter
    .parameter

    .prologue
    .line 30
    invoke-virtual {p1}, Landroid/widget/AbsListView;->getFirstVisiblePosition()I

    move-result v0

    .line 31
    invoke-virtual {p1}, Landroid/widget/AbsListView;->getLastVisiblePosition()I

    move-result v1

    .line 33
    iget v2, p0, Lcom/instagram/android/feed/a/a/g;->c:I

    if-le v0, v2, :cond_1

    .line 34
    invoke-direct {p0, v1}, Lcom/instagram/android/feed/a/a/g;->a(I)V

    .line 39
    :cond_0
    :goto_0
    iput v0, p0, Lcom/instagram/android/feed/a/a/g;->c:I

    .line 40
    return-void

    .line 35
    :cond_1
    iget v1, p0, Lcom/instagram/android/feed/a/a/g;->c:I

    if-ge v0, v1, :cond_0

    .line 36
    invoke-direct {p0, v0}, Lcom/instagram/android/feed/a/a/g;->b(I)V

    goto :goto_0
.end method
